package com.model;

// Generated 2013-8-25 14:56:38 by Hibernate Tools 3.6.0

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Tag generated by hbm2java
 */
@Entity
@Table(name = "timeline")
public class Timeline implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1476333731475701728L;

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	private Integer id;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id", nullable = false)
	private User user;

	@Column(name = "action", nullable = false, length = 128)
	private String action;

	@Column(name = "target_id", nullable = false)
	private int targetId;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_at", nullable = false, length = 19)
	private Date createAt;
	
	@Column(name = "is_public", nullable = false)
	private int isPublic;

	public Timeline() {
	}

	public Timeline(User user, String action, int targetId, Date createAt) {
		this.user = user;
		this.action = action;
		this.targetId = targetId;
		this.createAt = createAt;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public int getTargetId() {
		return targetId;
	}

	public void setTargetId(int targetId) {
		this.targetId = targetId;
	}

	public Date getCreateAt() {
		return createAt;
	}

	public void setCreateAt(Date createAt) {
		this.createAt = createAt;
	}

	public int getIsPublic() {
		return isPublic;
	}

	public void setIsPublic(int isPublic) {
		this.isPublic = isPublic;
	}

}
